// AClassifier.h: interface for the CAClassifier class.
//
//////////////////////////////////////////////////////////////////////

#ifndef A_CLASSIFIER_H
#define A_CLASSIFIER_H


#include "ASample.h"

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
class RectOfInterest
{
public:
	
	RectOfInterest()
	{
		cx		= 0.0;
		cy		= 0.0;
		scale	= 1.0;
		energy	= 0.0;
		Pr      = 0.0;
	}

	
	// operators
	RectOfInterest & operator=(const RectOfInterest&a)
	{
		if (this != &a)
		{
			rect	= a.rect;
			cx		= a.cx;
			cy		= a.cy;
			scale	= a.scale;
			energy	= a.energy;
			Pr      = a.Pr;
		}

		return *this;
	}
	
	bool	operator==(const RectOfInterest&a)
	{
		return (rect==a.rect);
	}
	
	inline irmm_Rect& Rect(void) {return rect;};

	inline int& Left(void) {return rect.left;};
	inline int& Right(void) {return rect.right;};
	inline int& Top(void) {return rect.top;};
	inline int& Bottom(void) {return rect.bottom;};

	inline int	Height(void) const {return rect.bottom-rect.top+1;};
	inline int	Width(void) const {return rect.right-rect.left+1;};

public:
	irmm_Rect	rect;

	double		cx,cy;
	double		scale;
	double		energy;
	double		Pr;
};

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

class CAClassifier  
{
public:
	char m_strID[20];
	vfeaid m_vFeaID;

	CAClassifier(){;};
	virtual ~CAClassifier(){};

	virtual float Classify(CASample *pSample, const char flag) = 0;
	virtual bool LoadFromFile(const char *strFileName) =0;
	virtual void LoadFromFile(FILE *fp) =0;
	virtual bool SaveToFile(const char *strFileName) =0;
	virtual void SaveToFile(FILE *fp) =0;
};

#define DETECT_TEXT 0
#define DETECT_FACE 1


typedef std::vector<CAClassifier *> CVPClassifier;

#endif 
